#include "syntheticsemivariogram.h"
#include <QList>
#include "modeloteorico.h"

SyntheticSemivariogram::SyntheticSemivariogram()
{

}

double SyntheticSemivariogram::getNuggetEffect(){

    return this->nuggetEffect;
}

double SyntheticSemivariogram::getLanding(){

    return this->landing;

}

double SyntheticSemivariogram::getReach(){

    return this->reach;
}

double SyntheticSemivariogram::getContribution(){

    return this->contribution;
}


void SyntheticSemivariogram::setNuggetEffect(double nuggetEffect){

    this->nuggetEffect = nuggetEffect;

}

void SyntheticSemivariogram::setLanding(double landing){

    this->landing = landing;
}

void SyntheticSemivariogram::setReach(double reach){

    this->reach = reach;
}


void SyntheticSemivariogram::setContribution(){
    this->contribution = this->landing - this->nuggetEffect;
}

//void Semivariogram::setParameters(){
//
//    double zero = 0;
//    this->nuggetEffect = LagrangeInterpolator::estimateValue(this->xSemivariogram,this->ySemivariogram,zero);
//    this->reach = this->xSemivariogram.at(xSemivariogram.size() - 1);
//    this->landing = this->ySemivariogram.at(ySemivariogram.size() - 1);
//    this->setContribution();
//
//}


QList<double > SyntheticSemivariogram::getAbscissas(){
    return this->abscissas;
}

QList<double > SyntheticSemivariogram::getOrdinates(){
    return this->ordinates;
}


void SyntheticSemivariogram::setAbscissas(QList<double > abscissasOfExperimental){

    this->abscissas = abscissasOfExperimental;
}

void SyntheticSemivariogram::setOrdinates(){

    int i = 0;
    double valueOfOrdinate;

    for(i = 0; i< this->abscissas.size();i++){

        valueOfOrdinate = ModeloTeorico::calculateSphericalModel(abscissas.at(i),this->reach,this->nuggetEffect,
                                                                 this->contribution);

        this->ordinates.append(valueOfOrdinate);

    }


}



